package com.qinghuan.ssm.service.impl;

import com.qinghuan.ssm.mapper.EmpMapper;
import com.qinghuan.ssm.pojo.Emp;
import com.qinghuan.ssm.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: dubao
 * @Date: 2022/4/23 10:39
 * @Description:
 */
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    EmpMapper empMapper;

    public List<Emp> getAll() {
        return empMapper.selectByExampleWithDept(null);
    }

    public Integer insert(Emp emp) {
        return empMapper.insertSelective(emp);
    }

    public Emp getEmp(Integer id) {
        return empMapper.selectByPrimaryKey(id);
    }

    public void updateEmp(Emp emp) {
        empMapper.updateByPrimaryKey(emp);
    }
}
